home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / PaperCut Quota / pc-setup.exe / {app} / WebAdmin / Log.asp < prev    next >
Text File  |  2005-02-04  |  4KB  |  98 lines

  1. <%@ Language=VBScript %>
  2. <%' (c) Copyright 1999-2004 PaperCut Software Pty. Ltd. %>
  3. <!-- #INCLUDE FILE="includes/PCCommon.inc" -->
  4. <%
  5. Dim intMAX_COUNT
  6. intMAX_COUNT = 100
  7.  
  8. %>
  9. <!-- #INCLUDE FILE="includes/header.inc" -->
  10. <%
  11.  
  12. Dim objPCWebLog
  13. Set objPCWebLog        = CreateObject("PCWebAdmin.PCWebLog")
  14. If objPCWebLog.Error Then
  15.     WriteErrorMessage objPCWebLog.ErrorDescription
  16. End If
  17.  
  18.  
  19. Dim strUserName
  20. strUserName = Trim(Request("strUserName"))
  21.  
  22. If Not gblnIsAdmin or Request("strMyLogs") <> "" Then
  23.     strUserName = gstrLoggedInUser
  24. End If
  25.  
  26. If strUserName <> "" Then
  27.     objPCWebLog.RestrictedOnUser(Trim(strUserName))
  28.     Response.Write "<H1>" & GetTextReplace("RecentPrintLogsBy", Array(strUserName)) & "</H1>"
  29.     WriteUserAdminLinks(strUserName)
  30.     Call DisplayList(False)
  31.     WriteUserAdminLinks(strUserName)
  32. Else
  33.     'objPCWebLog.FullLog ' Defaults to this anyway
  34.     Response.Write "<H1>" & GetText("RecentPrintJobs") & "</H1>"
  35.     Call DisplayList(True)
  36. End If
  37. Set objPCWebLog = Nothing
  38.  
  39. Sub DisplayList(blnShowUser)
  40.     Response.Write "<CENTER>" & vbCRLF
  41.     Response.Write "<TABLE class=""webAdmin"" width=""95%"" >"    & vbCRLF
  42.     Response.Write "<TR>" & vbCRLF
  43.     Response.Write "<TH width=""14%"">" & GetText("Time") & "</TH>" & vbCRLF
  44.     If blnShowUser Then
  45.         Response.Write "<TH width=""6%"">" & GetText("User") & "</TH>" & vbCRLF
  46.     End If
  47.     Response.Write "<TH width=""14%"">" & GetText("Printer") & "</TH>" & vbCRLF
  48.     Response.Write "<TH width=""19%"">" & GetText("Document") & "</TH>" & vbCRLF
  49.     Response.Write "<TH width=""5%"">" & GetText("Pages") & "</TH>" & vbCRLF
  50.     Response.Write "<TH width=""9%"">" & GetText("Cost") & "</TH>" & vbCRLF
  51.     Response.Write "<TH width=""9%"">" & GetText("Status") & "</TH>" & vbCRLF
  52.     If gblnHasChargeBack Then
  53.         Response.Write "<TH width=""14%"">" & GetText("Account") & "</TH>" & vbCRLF
  54.     End If
  55.     Response.Write "</TR>" & vbCRLF
  56.  
  57.  
  58.     objPCWebLog.MoveFirst
  59.     Dim intCount
  60.     intCount = 0
  61.  
  62.     do while ((not objPCWebLog.EOF) and intCount < intMAX_COUNT)
  63.  
  64.         Response.Write "<TR class=""" & RowClassHelper(intCount) & """>"    & vbCRLF
  65.         Response.Write "<TD nowrap align=left>" & objPCWebLog.Time & "</TD>"  & vbCRLF
  66.  
  67.         If blnShowUser Then
  68.             Response.Write "<TD nowrap align=left><a title=""" & GetTextReplace("ViewUserLogs", Array(objPCWebLog.UserName)) & """ href=""Log.asp?strUserName=" & Server.URLEncode(objPCWebLog.UserName) & """>" & objPCWebLog.UserName & "</A></TD>"  & vbCRLF
  69.         End If
  70.  
  71.         Response.Write "<TD align=left>" & objPCWebLog.PrinterName & "</TD>"  & vbCRLF
  72.         Response.Write "<TD align=left>" & objPCWebLog.DocumentName & "</TD>"  & vbCRLF
  73.         Response.Write "<TD align=right>" & FormatNumber(objPCWebLog.Pages, 0, true, false, true) & "</TD>"  & vbCRLF
  74.  
  75.  
  76.         Response.Write "<TD align=center>" & objPCWebLog.CostText & "</TD>"  & vbCRLF
  77.         'Response.Write "<TD align=center>" & objPCWebLog.Status & "</TD>"  & vbCRLF
  78.         Response.Write "<TD align=center>"
  79.         DisplayPrintJobStatus objPCWebLog.Status, objPCWebLog.UserName, objPCWebLog.Cost, objPCWebLog.LogEntryID, objPCWebLog.Refunded, objPCWebLog.Cancelled, objPCWebLog.Denied
  80.         Response.Write "</TD>"  & vbCRLF
  81.         If gblnHasChargeBack Then
  82.             Response.Write "<TD align=center>" & objPCWebLog.Account & "</TD>"  & vbCRLF
  83.         End If
  84.  
  85.         Response.Write "</TR>" & vbCRLF
  86.         objPCWebLog.MoveNext
  87.         intCount = intCount + 1
  88.     loop
  89.     Response.Write "</TABLE>" & vbCRLF
  90.     Response.Write "</CENTER>" & vbCRLF
  91.  
  92. End Sub
  93.  
  94.  
  95. %>
  96. </CENTER>
  97. <!-- #INCLUDE FILE="includes/footer.inc" -->
  98.